//
//  CZMesssageTableViewController.m
//  CZOC微博01
//
//  Created by 1 on 15/11/23.
//  Copyright © 2015年 itcast. All rights reserved.
//

#import "CZMesssageTableViewController.h"
#import "CZTextTableViewController.h"
@interface CZMesssageTableViewController ()

@end

@implementation CZMesssageTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.rightBarButtonItem=[[UIBarButtonItem alloc]initWithTitle:@"私信" style:UIBarButtonItemStylePlain target:self action:@selector(btnClick)];
    
//    self.navigationItem.rightBarButtonItem=[UIBarButtonItem alloc]initWithTitle:@"写私信" style:uii target:<#(nullable id)#> action:<#(nullable SEL)#>;
    
    
    
}

- (void)viewWillAppear:(BOOL)animated
{
    
    self.navigationItem.rightBarButtonItem.enabled=NO;
//    self.navigationItem.rightBarButtonItem.tintColor=[UIColor redColor];
}
- (void)btnClick
{
    NSLog(@"****");
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 20;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:@"cell"];
      if(!cell)
      {
          cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"];
      
      }
    
//     cell.detailTextLabel
    cell.textLabel.text=[NSString stringWithFormat:@"%ld",indexPath.row];
    
    return cell;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
       
    CZTextTableViewController *text1=[[CZTextTableViewController alloc]init];
    text1.hidesBottomBarWhenPushed=YES;//这句代码必须放在它推出的前面
    text1.title=@"测试的";
    //设置返回按钮和右边的按钮
    
    
    [self.navigationController pushViewController:text1 animated:YES];
   
    
}

@end
